{% extends base %}

{% block head %}

<link rel="stylesheet" type="text/css" href="{{_server_home}}/_static/lib/webuploader/webuploader.css">
<script type="text/javascript" src="{{_server_home}}/_static/lib/webuploader/webuploader.nolog.min.js"></script>
<script type="text/javascript" src="{{_server_home}}/_static/js/message/message.js"></script>

{% end %}

{% block body_left %}
    {% init tag_list = [] %}

    {% include message/component/message_title.html %}
    <!-- Tab页 -->
    {% include message/component/message_tab_log.html %}

    <!-- 月份选择器 -->
    {% include common/date/month_picker.html %}

    <!-- 二级目录 -->
    {% include message/component/message_sub_link.html %}

    <!-- 当月的标签 -->
    <div class="card">
        <h3 class="card-title">标签</h3>
        <span class="tag-span">
            <a class="link" href="/message/calendar?date={{date}}">全部</a>
        </span>
        
        {% for item in tag_list %}
            <span class="tag-span">
                <span>
                    <a class="link" href="{{item.url}}">{{item.name}}</a>
                    <span class="black">{{item.badge_info}}</span>
                </span>
            </span>
        {% end %}
    </div>

    
    <!-- 文字区域 -->
    {% include message/component/message_list.html %}

    <!-- 编辑 -->
    {% include message/component/message_edit.html %}

    <script type="text/javascript">
        $(function (e) {
            var date = "{{date}}";

            function getPage() {
                var page = getUrlParam("page");
                if (page == undefined) {
                    return 1;
                } else {
                    return parseInt(page);
                }
            }

            function onMonthSelected(event) {
                var date = event.target;
                window.location.href = "?date=" + date;
            }

            xnote.on("date.month.selected", onMonthSelected);

            refreshMessageList(date);
        })
    </script>

{% end %}
  
{% block body_right %}
    {% include message/component/message_date_right.html %}
{% end %}
